﻿using System;
using System.Collections.Generic;
using ExFlash.Actions;

namespace ExFlash.Tags
{
    public class DoInitActionTag : Tag
    {
        private readonly int _swfVersion;

        public ushort SpriteId
        {
            get;
            private set;
        }

        public List<ActionRecord> Actions
        {
            get;
            private set;
        }

        public DoInitActionTag(int len, int version, Int32 offset)
            : base(TagCodes.DoInitAction, len, offset)
        {
            _swfVersion = version;
        }

        public override void SwfDeserialize(BinaryBitReader reader)
        {
            SpriteId = reader.ReadUInt16();
            
            Actions = ActionAssistant.GetActions(reader, _swfVersion);
        }

        public override void SwfSerialize(byte[] arr, ref int offset)
        {
            throw new NotImplementedException();
        }
    }
}
